package com.hy.service1.controller;

import com.hy.service1.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("userService")
public class UserServiceController {

    @Resource
    private UserService userService;

    @GetMapping("getUserNameById")
    public Object getUserNameById(Integer id) {
        String userName = userService.getUserNameById(id);
        Map<String, Object> map = new HashMap<>();
        map.put("status", 200);
        map.put("result", userName);
        map.put("resultDesc", "");
        return map;
    }
}
